package bitmap
{
	import flash.display.BitmapData;

	/**
	 * 位图帧 
	 * @author Devin
	 */	
	public class BitmapFrame
	{
		private var _bitmapData:BitmapData;
		private var _width:int;
		private var _height:int;
		private var _registerX:int;
		private var _registerY:int;
		
		/**
		 * 位图帧 
		 * @param bitmapData 位图源
		 */		
		public function BitmapFrame(bitmapData:BitmapData, registerX:int, registerY:int)
		{
			_bitmapData=bitmapData;
			_registerX=registerX;
			_registerY=registerY;
			_width=_bitmapData.width;
			_height=_bitmapData.height;
		}
		
		/**
		 *位图帧宽度 
		 */		
		public function get width():int
		{
			return _width;
		}
		
		/**
		 *位图帧高度 
		 */	
		public function get height():int
		{
			return _height;
		}

		/**
		 *帧位图数据 
		 */
		public function get bitmapData():BitmapData
		{
			return _bitmapData;
		}

		public function get registerX():int
		{
			return _registerX;
		}

		public function get registerY():int
		{
			return _registerY;
		}
		
		/**
		 *释放资源 
		 */	
		public function dispose():void
		{
			_bitmapData.dispose();
			_bitmapData = null;
		}
	}
}